<template>
  <div>
    <el-card class="box-card" shadow="never">
      <div slot="header" class="clearfix">
        <p>{{ cardTitle }}</p>
      </div>
      <!-- 表单部分 -->
      <component :is="currentForm" :form-value="formValue" @getEqpForm="getEqpForm"/>
    </el-card>
  </div>
</template>
<script>
import searchForm from './components/searchForm'
import generateForm from '@/components/generateForm'
export default {
  name: 'ToolingChecklist',
  components: { searchForm, generateForm },
  mixins: [],
  props: {},
  data() {
    return {
      currentForm: 'searchForm',
      formValue: {}
    }
  },
  computed: {
    cardTitle() {
      return this.currentForm === 'searchForm' ? this.$t('ToolingChecklist') : this.$t('EquipmentChecklist')
    }
  },
  methods: {
    getEqpForm(val) {
      this.currentForm = 'generateForm'
      this.formValue = val.form
    }
  }
}
</script>

<style scoped lang="scss">
.el-card {
    width: 750px;
    margin:  0 auto;
    margin-bottom: 33px;
    ::v-deep .el-card__header{
        padding: 0 20px;
    }
    .clearfix{
        p{
            font-size: 16px;
            font-weight: bold;
        }
    }
}
</style>
